package com.suanfa.tianxun;

import java.util.Arrays;

/**
 * @author tianxun
 * @date 2023/12/14 14:59
 * @desc 快速排序
 */
public class QuickSort {
    public static void main(String[] args) {
        int[] arr = {27, 700, 49, 33, 49, 11, 101, 1};
        quickSort(arr[0],0,arr.length-1,arr);
        System.out.println(Arrays.toString(arr));
    }

    private static void quickSort(int standard,int left, int right,int[] arr) {
        if(arr.length==0||arr.length==1){
            System.out.println("数组无需排序："+Arrays.toString(arr));
        }
        int standardIndex = findStandard(standard, left, right, arr);
        quickSort(arr[0],0,standardIndex,arr);
        quickSort(arr[standardIndex+1],standardIndex+1,arr.length-1,arr);
    }

    private static Integer findStandard(int standard, int left, int right,int[] arr) {
        return 0;
    }

    private static void swap(int left, int right, int[] arr) {
        int tmp = arr[left];
        arr[left] = arr[right];
        arr[right] = tmp;
    }


}
